package stra

import (
	"fmt"
	"time"

	"github.com/didi/nightingale/src/models"
	"github.com/didi/nightingale/src/modules/agent/config"
)

func NewServiceCollect(service, proc, conf, data, ignore, version, port, cron string, modTime time.Time) *models.ServiceCollect {
	return &models.ServiceCollect{
		CollectType: "service",
		ServicePath: service,
		ProcPath:    proc,
		ConfigPath:  conf,
		DataPath:    data,
		IgnorePath:  ignore,
		Version:     version,
		Port:        port,
		Cron:        cron,
		LastUpdated: modTime,
	}
}

func GetServiceCollects() map[string]*models.ServiceCollect {
	services := make(map[string]*models.ServiceCollect)

	if config.Config.Stra.Enable {
		services = Collect.GetService()
	}

	return services
}

func parseServiceInfo(fname string) (service, proc, conf, data, ignore, version, port, cron string, err error) {
	fmt.Println("fname is:", fname)
	return
}
